package com.yangaobo.dto;

import com.yangaobo.constant.MC;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author 杨奥博
 */
@Schema(description = "员工添加DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class EmpInsertDTO implements Serializable {

    @Schema(description = "登录账号")
    @NotEmpty(message = "登录账号不能为空")
    @Pattern(regexp = MC.Regex.USERNAME_RE, message = MC.Regex.USERNAME_RE_MSG)
    private String username;

    @Schema(description = "员工姓名")
    @NotEmpty(message = "员工姓名不能为空")
    private String realname;

    @Schema(description = "员工手机号")
    @NotEmpty(message = "员工手机号不能为空")
    @Pattern(regexp = MC.Regex.PHONE_RE, message = MC.Regex.PHONE_RE_MSG)
    private String phone;

    @Schema(description = "员工微信号")
    @NotEmpty(message = "员工微信号不能为空")
    private String wechat;

    @Schema(description = "员工邮箱")
    @NotEmpty(message = "员工邮箱不能为空")
    @Pattern(regexp = MC.Regex.EMAIL_RE, message = MC.Regex.EMAIL_RE_MSG)
    private String email;

    @Schema(description = "员工详细地址")
    @NotEmpty(message = "员工详细地址不能为空")
    private String address;

    @Schema(description = "员工身份证号")
    @NotEmpty(message = "员工身份证号不能为空")
    @Pattern(regexp = MC.Regex.ID_CARD_RE, message = MC.Regex.ID_CARD_RE_MSG)
    private String idcard;

    @Schema(description = "部门外键")
    @NotNull(message = "部门外键不能为空")
    @Min(value = 1, message = "部门外键必须大于等于1")
    private Long fkDeptId;

    @Schema(description = "员工描述")
    private String info;

    @Schema(description = "员工入职时间", example = "2023-01-01T00:00:00Z")
    @NotNull(message = "员工入职时间不能为空")
    private LocalDateTime hiredate;

}
